package demo1;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        String name = "abc我爱你中国";
        byte[] bytes = name.getBytes();//用当前代码字符集进行编码（UTF-8）
        System.out.println(bytes.length);
        System.out.println(Arrays.toString(bytes));
    }
}
